(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[     10983,        299]
NotebookOptionsPosition[      9844,        256]
NotebookOutlinePosition[     10361,        278]
CellTagsIndexPosition[     10276,        273]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[{
 RowBox[{
  RowBox[{"<<", "Matcher`"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"<<", "Classifier`"}], ";"}]}], "Input",
 CellChangeTimes->{{3.508300266203125*^9, 3.508300271640625*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "VF"}]], "Input",
 CellChangeTimes->{{3.508142098484375*^9, 3.5081420994375*^9}}],

Cell[BoxData[
 StyleBox["\<\"VF[true_group, predicted_group] returns Error rate, FAR and \
FRR\"\>", "MSG"]], "Print", "PrintUsage",
 CellChangeTimes->{3.5083002763125*^9},
 CellTags->"Info3508329076-9412748"]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"use", " ", "Distance_cls", 
   RowBox[{"_nxr", ".", "nb"}], " ", "here"}], "*)"}]], "Input",
 CellChangeTimes->{
  3.50814191184375*^9, {3.508142036796875*^9, 3.508142058046875*^9}, {
   3.508301833890625*^9, 3.508301839984375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"pg", "=", 
   RowBox[{"classifyDist1", "[", 
    RowBox[{"sdata", ",", "templ", ",", "1.3"}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.508141839171875*^9, 3.50814184328125*^9}, {
  3.50814207059375*^9, 3.508142070828125*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"rr", "=", 
   RowBox[{
    RowBox[{"Reap", "[", 
     RowBox[{"For", "[", 
      RowBox[{
       RowBox[{"i", "=", "0"}], ",", 
       RowBox[{"i", "<", "4"}], ",", 
       RowBox[{"i", "=", 
        RowBox[{"i", "+", "0.05"}]}], ",", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Sow", "[", 
         RowBox[{
          RowBox[{"VF", "[", 
           RowBox[{"tg", ",", 
            RowBox[{"classifyDist1", "[", 
             RowBox[{"sdata", ",", "templ", ",", "i"}], "]"}]}], "]"}], "[", 
          RowBox[{"[", 
           RowBox[{"{", 
            RowBox[{"2", ",", "3"}], "}"}], "]"}], "]"}], "]"}], ";"}]}], 
      "\[IndentingNewLine]", "]"}], "]"}], "[", 
    RowBox[{"[", 
     RowBox[{"2", ",", "1"}], "]"}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.50814193925*^9, 3.508141976046875*^9}, {
   3.50814206378125*^9, 3.50814211409375*^9}, {3.508142180859375*^9, 
   3.50814229825*^9}, {3.50814233771875*^9, 3.5081423871875*^9}, 
   3.508142713953125*^9}],

Cell[BoxData[
 RowBox[{"ListPlot", "[", 
  RowBox[{
   RowBox[{"rr", "*", "100"}], ",", 
   RowBox[{"Joined", "\[Rule]", "True"}], ",", 
   RowBox[{"Frame", "\[Rule]", "True"}], ",", 
   RowBox[{"FrameLabel", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"\"\<FAR (%)\>\"", ",", "\"\<FRR (%)\>\""}], "}"}]}], ",", 
   RowBox[{"AxesOrigin", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0"}], "}"}]}], ",", 
   RowBox[{"PlotStyle", "\[Rule]", "Dashed"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.508142304359375*^9, 3.5081423295*^9}, {
  3.50814251246875*^9, 3.508142516171875*^9}, {3.508142569203125*^9, 
  3.50814257340625*^9}, {3.508142695359375*^9, 3.508142720796875*^9}, {
  3.508142912578125*^9, 3.5081429716875*^9}}],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.508301469890625*^9, 3.50830146990625*^9}}],

Cell[BoxData[
 RowBox[{"(*", "EER", "*)"}]], "Input",
 CellChangeTimes->{{3.5081426454375*^9, 3.508142649609375*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"For", "[", 
   RowBox[{
    RowBox[{"i", "=", "7"}], ",", 
    RowBox[{"i", "<", "8"}], ",", 
    RowBox[{"i", "=", 
     RowBox[{"i", "+", "0.002"}]}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{"{", 
       RowBox[{"far", ",", "frr"}], "}"}], "=", 
      RowBox[{
       RowBox[{"VF", "[", 
        RowBox[{"tg", ",", 
         RowBox[{"classifyDist1", "[", 
          RowBox[{"pdata", ",", "templ", ",", "i"}], "]"}]}], "]"}], "[", 
       RowBox[{"[", 
        RowBox[{"{", 
         RowBox[{"2", ",", "3"}], "}"}], "]"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Abs", "[", 
         RowBox[{"far", "-", "frr"}], "]"}], "\[LessEqual]", "0.005"}], ",", 
       RowBox[{"Break", "[", "]"}]}], "]"}], ";"}]}], "\[IndentingNewLine]", 
   "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"{", 
  RowBox[{"i", ",", "far", ",", "frr"}], "}"}]}], "Input",
 CellChangeTimes->{
  3.508142653359375*^9, {3.508142795203125*^9, 3.508142841703125*^9}, 
   3.508142873625*^9, {3.508143151796875*^9, 3.508143182140625*^9}, {
   3.508146449640625*^9, 3.508146537703125*^9}, {3.50814661321875*^9, 
   3.508146618015625*^9}, {3.5081470425625*^9, 3.508147042921875*^9}, 
   3.508147114*^9, {3.508301829421875*^9, 3.5083018663125*^9}, {
   3.508301927609375*^9, 3.508301978390625*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"7.533999999999941`", ",", "0.16163265306122448`", ",", "0.16`"}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.508143191421875*^9, 3.508146465609375*^9, {3.508146498515625*^9, 
   3.50814652478125*^9}, 3.508146601140625*^9, 3.508147036328125*^9, 
   3.508147110109375*^9, 3.508301872703125*^9, 3.5083019386875*^9, {
   3.50830197053125*^9, 3.508301987046875*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"VF", "[", 
  RowBox[{"tg", ",", 
   RowBox[{"classifyDist1", "[", 
    RowBox[{"pdata", ",", "templ", ",", "7.5336"}], "]"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.50830144784375*^9, 3.5083014480625*^9}, {
  3.50830147978125*^9, 3.508301479953125*^9}, {3.5083020315625*^9, 
  3.50830206196875*^9}, {3.50830224678125*^9, 3.508302366828125*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"0.1612`", ",", "0.16122448979591836`", ",", "0.16`"}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.508302037375*^9, 3.508302062328125*^9}, {
  3.5083022473125*^9, 3.508302367453125*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"pg", "=", 
  RowBox[{"RocPlot", "[", 
   RowBox[{"pdata", ",", "templ", ",", "tg", ",", "classifyDist1"}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.508142122203125*^9, 3.5081421246875*^9}, 
   3.508142219265625*^9, {3.508301136078125*^9, 3.5083011560625*^9}, 
   3.50830119028125*^9, {3.5083012678125*^9, 3.508301268203125*^9}, {
   3.508301377109375*^9, 3.508301378109375*^9}}],

Cell[BoxData[
 GraphicsBox[
  {Hue[0.67, 0.6, 0.6], Dashing[{Small, Small}], LineBox[CompressedData["
1:eJzt2UuIlWUYwPHjrZuVVtpFK7W01C6amqnVeHK8pImVSmkLAy2whQW2yI0x
2MIWtbGFLWxhBLawhS1sI4QRBhlUEAopZJQSGaFdJLQyv/d/zvOnIw+dZsZo
oQiHn+PMOd9ze5/vm1Ern1v8dN9arTaqX61Wvf79z/L6eZ93t921rHdd66G7
Hj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nmo2Y+as4zTX9q8qXZLzX50+wb
mnmZm9c5YeapZt/IzbzV9Lcmv5r+1OQ3N/uKJt+a+azpT03/tW/6LzfzWTOf
Nf2ouR/KTX5zk19NP2rynZv7a82+Mzc1+dX0qya/mvmsya8mf5r85aZfNeet
5v5Z05+5ma+a53uaftbsR5rfZ2ryrZnHmvxr8p2b+azJf272WU195Ob5hKYe
cvM6L8y818x7zbzX1Idmnmv6W3N/kpt5r6mP7pt60sx/TX1pzoPc/P5b8zxP
Mz9yU1+a/To39aY5X3KzH+bm/MlN/WnOn9zMJ8080rw+2LaZT5p6zP0XLtyS
5w==
    "]]},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->True,
  AxesOrigin->{0, 0},
  Frame->True,
  FrameLabel->{
    FormBox["\"FAR (%)\"", TraditionalForm], 
    FormBox["\"FRR (%)\"", TraditionalForm]},
  ImageSize->{460.8333333333335, Automatic},
  PlotRange->Automatic,
  PlotRangeClipping->True]], "Output",
 CellChangeTimes->{3.508301193671875*^9, 3.508301270953125*^9, 
  3.5083013795625*^9, 3.50830142096875*^9, 3.508301573890625*^9, 
  3.508301689453125*^9}]
}, Open  ]]
},
WindowSize->{782, 719},
WindowMargins->{{214, Automatic}, {Automatic, -9}},
ShowSelection->True,
FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (November 10, 2008)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "Info3508329076-9412748"->{
  Cell[894, 33, 209, 4, 45, "Print",
   CellTags->"Info3508329076-9412748"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"Info3508329076-9412748", 10175, 267}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 212, 5, 67, "Input"],
Cell[CellGroupData[{
Cell[782, 29, 109, 2, 39, "Input"],
Cell[894, 33, 209, 4, 45, "Print",
 CellTags->"Info3508329076-9412748"]
}, Open  ]],
Cell[1118, 40, 273, 6, 39, "Input"],
Cell[1394, 48, 267, 6, 39, "Input"],
Cell[1664, 56, 1017, 27, 94, "Input"],
Cell[2684, 85, 727, 16, 94, "Input"],
Cell[3414, 103, 91, 1, 39, InheritFromParent],
Cell[3508, 106, 117, 2, 39, "Input"],
Cell[CellGroupData[{
Cell[3650, 112, 1406, 36, 175, "Input"],
Cell[5059, 150, 403, 8, 38, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[5499, 163, 370, 7, 39, "Input"],
Cell[5872, 172, 225, 5, 38, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6134, 182, 406, 8, 39, "Input"],
Cell[6543, 192, 3285, 61, 375, "Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
